Skip to content

Conversation

@tarang-jain
Copy link
Contributor

@tarang-jain tarang-jain commented Oct 31, 2025

IVF-PQ Index Build API Enhancements and Pimpl Refactoring
Summary
This PR adds new build APIs for IVF-PQ indices using precomputed centroids and implements a complete PIMPL refactoring with owning/view semantics
Key Changes

  1. New Build APIs for Precomputed Centroids
    Added cuvs::neighbors::ivf_pq::build() overloads that accept precomputed cluster centroids, PQ codebooks, and rotation matrices
    Enables building indices from pre-trained models without re-training
    Supports both device and host input data with automatic memory transfer
  2. PIMPL Refactoring with Owning/View Semantics
    owning_impl: Owns centroid and codebook data (traditional behavior)
    view_impl: References external centroid data without copying
    Maintains identical search behavior with zero data copying
  3. Enhanced Helper Functions
    Removed mutator functions that directly modify the state of the index. Instead we have helpers for the user to fetch and own the transformed data

View indices avoid copying large centroid arrays
Backward Compatibility: All existing APIs work unchanged

@copy-pr-bot
Copy link

copy-pr-bot bot commented Oct 31, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@tarang-jain tarang-jain self-assigned this Oct 31, 2025
@tarang-jain tarang-jain added feature request New feature or request non-breaking Introduces a non-breaking change labels Oct 31, 2025
@tarang-jain tarang-jain changed the title [FEA] IVF_PQ build_from_args API [WIP] [FEA] IVF_PQ build_from_args API Oct 31, 2025
@tarang-jain tarang-jain marked this pull request as ready for review November 21, 2025 19:51
@tarang-jain tarang-jain requested review from a team as code owners November 21, 2025 19:51
@tarang-jain tarang-jain requested a review from AyodeAwe November 21, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

Development

Successfully merging this pull request may close these issues.

7 participants